home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Presentations
/
Presentations ’93
/
Voice Toolkit
/
Voice Flag
< prev
next >
Wrap
Lisp/Scheme
|
1993-06-16
|
3KB
|
103 lines
(in-package "VOICE-TOOLKIT")
(defparameter *f-status* 0)
(defclass flag (windoid) ())
(defmethod view-draw-contents ((self flag))
(call-next-method self)
(cond ((= *f-status* 0) (clean-flag))
((= *f-status* 1) (question))
((= *f-status* 2) (question-guess))
((= *f-status* 3) (smile))
(t (frown))))
(defparameter *flag*
(make-instance 'flag
:view-size #@(50 50)
:close-box-p nil
:window-show nil
:view-position (make-point 120 (- *screen-height* 70)))
"windoid status display")
(defun hide-flag ()
(window-hide *flag*))
(defun show-flag ()
(window-show *flag*)
(view-draw-contents *flag*))
(defun blank-flag ()
(setf *f-status* 0)
(clean-flag))
(defun clean-flag ()
(set-fore-color *flag* *white-color*)
(paint-rect *flag* #@(0 0) #@(50 50)))
(defun question ()
"Draws blue question mark"
(if (not (= *f-status* 1))
(setf *f-status* 1))
(window-show *flag*)
(clean-flag)
(set-pen-size *flag* #@(4 4))
(set-fore-color *flag* *blue-color*)
(frame-arc *flag* 180 -270 #@(15 5) #@(35 25))
(move-to *flag* #@(23 21))
(line-to *flag* #@(23 28))
(move-to *flag* #@(23 35))
(line-to *flag* #@(23 37)))
(defun question-guess ()
"Draws red question mark"
(if (not (= *f-status* 2))
(setf *f-status* 2))
(window-show *flag*)
(clean-flag)
(set-pen-size *flag* #@(4 4))
(set-fore-color *flag* *red-color*)
(frame-arc *flag* 180 -270 #@(15 7) #@(35 27))
(move-to *flag* #@(23 23))
(line-to *flag* #@(23 30))
(move-to *flag* #@(23 37))
(line-to *flag* #@(23 39))
(frame-oval *flag* #@(2 2) #@(48 48)))
(defun smile ()
(if (not (= *f-status* 3))
(setf *f-status* 3))
(window-show *flag*)
(clean-flag)
(set-pen-size *flag* #@(2 2))
(set-fore-color *flag* *yellow-color*)
(paint-oval *flag* #@(5 5) #@(45 45))
(set-fore-color *flag* *black-color*)
(frame-oval *flag* #@(5 5) #@(45 45))
(paint-oval *flag* #@(16 19) #@(20 23))
(paint-oval *flag* #@(30 19) #@(34 23))
(frame-arc *flag* 90 180 #@(15 23) #@(35 38)))
(defun frown ()
(if (not (= *f-status* 4))
(setf *f-status* 4))
(window-show *flag*)
(clean-flag)
(set-pen-size *flag* #@(2 2))
(set-fore-color *flag* *green-color*)
(paint-oval *flag* #@(5 5) #@(45 45))
(set-fore-color *flag* *black-color*)
(frame-oval *flag* #@(5 5) #@(45 45))
(paint-oval *flag* #@(16 19) #@(20 23))
(paint-oval *flag* #@(30 19) #@(34 23))
(frame-arc *flag* 90 -180 #@(15 28) #@(35 43)))